<%--
  Created by IntelliJ IDEA.
  User: qintao30057
  Date: 2018/1/9
  Time: 13:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>编辑菜单</title>
    <%@ include file="../../../common/meta.jsp" %>
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
    <style>
        .myContent{
            height: 100%!important;
        }
        #_parentMenu {
        <c:choose>
            <c:when test="${not empty menu && menu.menuLevel != '1'}">
            display: block;
            </c:when>
            <c:otherwise>
            display: none;
            </c:otherwise>
        </c:choose>
        }
    </style>
    <script>
        var searchInfo = ${searchInfo};
        var editType = '${type}';
        var oneMenuInfo = ${menu};
        var menuLevelMap = '${menuLevelMap}';
    </script>
</head>
<body class="gray-bg">
<div class="myContent">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>菜单信息</h5>
                </div>
                <div class="ibox-content">
                    <h5><i class="fa fa-file-text"></i>  基本信息</h5>
                    <hr>
                    <form class="form-horizontal m-t" id="_menuDataForm" novalidate="novalidate">
                        <%--<h4 class="page-header page-header-new"><a href="#file-text"><i class="fa fa-file-text"></i>&nbsp;&nbsp;基本信息</a></h4>--%>
                        <c:choose>
                            <c:when test="${type=='info'}">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">菜单类型：</label>
                                    <label class="col-sm-8 control-label control-label-content">
                                        <c:if test="${not empty menuLevelMap}">
                                            <c:forEach items="${menuLevelMap}" var="item">
                                                ${not empty menu && menu.menuLevel == item.code? item.name : ''}
                                            </c:forEach>
                                        </c:if>
                                    </label>
                                </div>
                                <div class="form-group" id="_parentMenu">
                                    <label class="col-sm-2 control-label">父菜单名称：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.parentMenuName : ''}</label>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">菜单名称：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.menuName : ''}</label>
                                </div>
                                   <div class="form-group">
                                    <label class="col-sm-2 control-label">菜单图标：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.menuImg : ''}</label>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">菜单地址：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.menuUrl : ''}</label>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">排序：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.sortNum : ''}</label>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">备注：</label>
                                    <label class="col-sm-8 control-label control-label-content">${not empty menu?menu.remark : ''}</label>
                                </div>
                            </c:when>
                            <c:otherwise>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>菜单类型：</label>
                                    <div class="col-sm-8">
                                        <c:choose>
                                            <c:when test="${type=='add'}">
                                                <select type="text" id="menuLevel" name="menuLevel" class="form-control" onchange="doMenuLevelChange()" required>
                                                    <c:if test="${not empty menuLevelMap}">
                                                        <c:forEach items="${menuLevelMap}" var="item">
                                                            <option value="${item.code}" ${not empty menu && menu.menuLevel == item.code? 'selected' : '' }>${item.name}</option>
                                                        </c:forEach>
                                                    </c:if>
                                                </select>
                                            </c:when>
                                            <c:otherwise>
                                                <label class="col-sm-8 control-label control-label-content">
                                                     <c:if test="${not empty menuLevelMap}">
                                                        <c:forEach items="${menuLevelMap}" var="item">
                                                            ${not empty menu && menu.menuLevel == item.code? item.name : '' }
                                                        </c:forEach>
                                                    </c:if>
                                                </label>
                                            </c:otherwise>
                                        </c:choose>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new" id="_parentMenu">
                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>父菜单名称：</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <input type="hidden" id="parentId" name="parentId" value="${not empty menu ? menu.parentId : ''}">
                                            <input type="text" id="parentMenuName" name="parentMenuName" class="form-control" maxlength="10" required value="${not empty menu?menu.parentMenuName : ''}">
                                            <div class="input-group-btn">
                                                <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                                    <span class="caret"></span>
                                                </button>
                                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                                </ul>
                                            </div>
                                        </div>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>菜单名称：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="menuName" name="menuName" class="form-control" value="${not empty menu ? menu.menuName : ''}" maxlength="10" required>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label">菜单图标：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="menuImg" name="menuImg" class="form-control" value="${not empty menu ? menu.menuImg : ''}" maxlength="64">
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>菜单地址：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="menuUrl" name="menuUrl" class="form-control" value="${not empty menu ? menu.menuUrl : ''}" maxlength="50" required>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label"><span style="color: red">*</span>排序：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="sortNum" name="sortNum" class="form-control" value="${not empty menu ? menu.sortNum : ''}" maxlength="9" isPInteger="true" required>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                                <div class="form-group form-group-new">
                                    <label class="col-sm-2 control-label">&nbsp;备注：</label>
                                    <div class="col-sm-8">
                                        <textarea type="text" id="remark" name="remark" class="form-control" style="height: 80px; resize: none;" maxlength="200">${not empty menu ? menu.remark : ''}</textarea>
                                        <span class="help-block m-b-none tip"></span>
                                    </div>
                                </div>
                            </c:otherwise>
                        </c:choose>
                        <div class="form-group form-group-new" id="_btnDiv">
                            <div class="col-sm-4 col-sm-offset-5">
                                <c:if test="${type!='info'}">
                                    <input type="button" class="btn btn-primary" onclick="doMenuSave()" value="保存">
                                </c:if>
                                <input type="button" class="btn btn-white" onclick="doBack()" value="返回">
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="${ctx}/js/sys/menu/win/editPfMenuMgr.js?t=${now}"></script>
</body>
</html>
